package com.jk.controller;

import com.jk.entity.Order;
import com.jk.entity.OrderItem;
import com.jk.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;

@Controller
public class OrderController {

    @Autowired
    private OrderService orderService;

    @RequestMapping("toMyOrder")
    public  String toMyOrder(){
        return  "myorder";
    }

    @RequestMapping("queryOrderLisr")
    @ResponseBody
    public List<Order> queryOrderLisr(HttpServletRequest request){
        return  orderService.queryOrderLisr(request);
    }


    @RequestMapping("GetOrderList")
    @ResponseBody
    public List<Order> GetOrderList(HttpServletRequest request,Order order){
        return  orderService.GetOrderList(request,order);
    }


    /* 订单列表  ----------------------- 删除订单 */
    @RequestMapping("/delOrder")
    public String delOrderId(String[] ids){
        orderService.delOrderId(ids);
        return  null;
    }


    @RequestMapping("queryOrderItme")
    @ResponseBody
    public List<OrderItem> queryOrderItme(String oid){
        return     orderService.queryOrderItme(oid);
    }


}
